package com.learn.micro_mall.service.convertor.goods;

import com.learn.micro_mall.domain.entity.goods.GoodsEntity;
import com.learn.micro_mall.domain.entity.goods.GoodsSkuParamEntity;
import com.learn.micro_mall.service.request.goods.GoodsCreateRequest;
import com.learn.micro_mall.service.request.goods.GoodsSkuParamCreateRequest;
import com.learn.micro_mall.service.request.goods.GoodsSkuParamUpdateRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface GoodsMapper {

    /**
     * 获取该类自动生成的实现类的实例
     * 接口中的属性都是 public static final 的 方法都是public abstract的
     */
    GoodsMapper INSTANCES = Mappers.getMapper(GoodsMapper.class);


//    @Mappings({
//            @Mapping(source = "id", target = "userId"),
//            @Mapping(source = "username", target = "name"),
//            @Mapping(source = "role.roleName", target = "roleName")
//    })
//    @Mappings({
//            @Mapping(source = "goodsId", target = "goodsId.goodsId"),
//            @Mapping(source = "skuCreateDTOList", target = "skuEntities")
//    })
//    GoodsEntity toGoodsEntity(GoodsCreateRequest request);

}
